package org.linlinjava.litemall.admin.util;

public class ShortCodeUtil {
    /**
     * 随机生成6位数字字符数组
     * 
     * @return rands
     */
    public static String generateCode(int len) {
        String chars = "0123456789";
       StringBuffer stringBuffer=new StringBuffer();
        for (int i = 0; i < len; i++) {
            int rand = (int) (Math.random() * 10);
            stringBuffer.append(chars.charAt(rand));
        }
        return stringBuffer.toString();
    }
}
